﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<OptimumInfra.ViewData.ViewDataNewsletter>" %>


<asp:Content ID="registerContent" ContentPlaceHolderID="AdminContent" runat="server">
    <h2>Send newsletter</h2>

    <% if(TempData["info"] !=null) { %>
    <p style="text-align: center; color: Red;"><%=TempData["info"] %></p>
    <% } %>

    <% using (Html.BeginForm("SendNewsletter", "Newsletter", FormMethod.Post, new {id="resourceCreate", name="resourceCreate"})) { %>
          <table width="700px" style="margin-top: 10px;">
          <tr>
          <td>          
                <div class="editor-label">
                    <%: Html.LabelFor(newsletter => newsletter.Sender) %>
                </div>
            </td> 
            <td>
                <div class="editor-field">
                    <input type="text" value="optimuminfra@optimum.vn" name="Sender" id="Sender" />
                </div>
           </td> 
          </tr>
           <tr>
               <td>
                <div class="editor-label">
                    <%: Html.LabelFor(m => m.Receiver) %>
                </div>
                </td> 
                <td>
                <div class="editor-field">
                   <%: Html.TextBoxFor(m => m.Receiver)%>
                    <%: Html.ValidationMessageFor(m => m.Receiver)%>
                </div>
                </td>
  
            </tr>
            <tr>
               <td>
                <div class="editor-label">
                    <%: Html.LabelFor(m => m.Subject) %>
                </div>
                </td> 
                <td>
                <div class="editor-field">
                   <%: Html.TextBoxFor(m => m.Subject)%>
                    <%: Html.ValidationMessageFor(m => m.Subject)%>
                </div>
                </td>
  
            </tr>                 
          <tr>       
            <td>
                <div class="editor-label">
                    <%: Html.LabelFor(m => m.Content) %>
                </div>
            </td>
            <td>
                 <div class="editor-field">
                    <%: Html.TextAreaFor(m => m.Content, 4, 10, new {style = "width: 95%; height:200px;", @class = "textarea" })%>
                    <%: Html.ValidationMessageFor(m => m.Content)%>
                </div>
            </td>
          </tr>          
             <tr>       
            <td colspan="2">
                <p>
                    <input type="submit" value="Send" />
                </p>
            </td>
          </tr>   
            </table>
    <% } %>
     <script type="text/javascript">
         $(document).ready(function () {

             $("#resourceCreate").validate({
                 rules: {
                     Name: "required" // simple rule, converted to {required:true} 

                 },
                 messages: { Name: "* Name is required" }

             });
         }); 
	  </script>
</asp:Content>
